package com.keeson.android_cli.api;

import com.keeson.android_cli.base.BaseRespose;
import com.keeson.android_cli.bean.PressureInfo;
import com.keeson.android_cli.bean.request.LoginRequest;
import com.keeson.android_cli.bean.request.ModifyBedMattressRequest;
import com.keeson.android_cli.entity.BedBindInfo;
import com.keeson.android_cli.entity.UserInfo;
import java.util.ArrayList;
import java.util.Map;
import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by jiaqiZHou
 * on 2020/12/4
 */
public interface ApiService {

    /**************************************************User*********************************************************************************/

    /**
     * 获取验证码
     */
    @GET("/qs-gasbag-system/api/v1/user/getVerificationCode")
    Observable<BaseRespose<String>> getVerificationCode(@Query("phone") String phone, @Query("area_code") String area_code);

    /**
     * 登录
     */
    @POST("/qs-gasbag-system/api/v1/user/login")
    Observable<BaseRespose<UserInfo>> logins(@Body LoginRequest postBody);


    /**
     * 验证码校验
     */
    @FormUrlEncoded
    @POST("/qs-gasbag-system/api/v1/user/checkVerificationCode")
    Observable<BaseRespose<String>> checkVerificationCode(@FieldMap Map<String, Object> maps);



    /**
     * 查询用户信息
     */
    @GET("/qs-gasbag-system/api/v1/user/getUserInfoById")
    Observable<BaseRespose<UserInfo>> getUserInfoById(@Query("id") int id);



    /**
     * 刷新token
     */
    @GET("/qs-gasbag-system/api/v1/user/refreshToken")
    Observable<BaseRespose<UserInfo>> refreshToken(@Query("id") int id);



    /**
     * 修改用户信息
     */
    @POST("/qs-gasbag-system/api/v1/user/modifyUserInfo")
    Observable<BaseRespose<String>> modifyUserInfo(@Body UserInfo postBody);


    /**
     * 修改密码
     */
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    @FormUrlEncoded
    @POST("/qs-gasbag-system/api/v1/user/modifyPassword")
    Observable<BaseRespose<String>> modifyPassword(@FieldMap Map<String, Object> maps);



    /**
     * 忘记密码
     */
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    @FormUrlEncoded
    @POST("/qs-gasbag-system/api/v1/user/forgetUserPassword")
    Observable<BaseRespose<String>> forgetUserPassword(@FieldMap Map<String, Object> maps);


    /**************************************************bed*********************************************************************************/

    /**
     * 计算推荐床垫厚度
     */
    @GET("/qs-gasbag-system/api/v1/bed/getBedMattressInfo")
    Observable<BaseRespose<UserInfo>> getBedMattressInfo(@Query("id") int id);

    /**
     * 查询绑定信息
     */
    @GET("/qs-gasbag-system/api/v1/bed/getUserBindInfo")
    Observable<BaseRespose<BedBindInfo>> getUserBindInfo(@Query("id") int id);

    /**
     * 解绑床垫
     */
    @FormUrlEncoded
    @POST("/qs-gasbag-system/api/v1/bed/deleteUserBindInfo")
    Observable<BaseRespose<String>> deleteUserBindInfo(@FieldMap Map<String, Object> maps);

    /**
     * 修改床垫  绑定  同一个接口
     */
    @POST("/qs-gasbag-system/api/v1/bed/modifyUserBindInfos")
    Observable<BaseRespose<String>> modifyUserBindInfos(@Body ModifyBedMattressRequest postBody);


    /**
     * 记忆位置修改
     */
    @FormUrlEncoded
    @POST("/qs-gasbag-system/api/v1/bed/modifyUserMemoryInfo")
    Observable<BaseRespose<String>> modifyUserMemoryName(@FieldMap Map<String, Object> maps);


    /**
     * 查询压强值
     */
    @GET("/qs-gasbag-system/api/v1/bed/getPressureInfo")
    Observable<BaseRespose<ArrayList<PressureInfo>>> getPressureInfo(@Query("hardware_version") String hardware_version);

}
